<?php

namespace App\Models\Shop;

use Illuminate\Database\Eloquent\Model;

class OrderProduct extends Model
{
    //黑名单
    protected $guarded = [];

    //屏蔽时间字段
    public $timestamps = false;

    //设置别名,关联到模型的数据表
    protected $table = 'order_products';

    //订单产品属于订单
    public function order(){
        return $this->belongsTo('App\Models\Shop\Order');
    }

    //订单产品属于订单
    public function product(){
        return $this->belongsTo('App\Models\Shop\Product');
    }
}
